package com.yonyou.isv.demo.openapi.api.product;

import com.yonyou.isv.demo.openapi.api.*;
import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataArrayResponse;
import com.yonyou.isv.demo.openapi.base.module.reponse.ApiDataResponse;
import com.yonyou.isv.demo.openapi.base.module.reponse.ApiStringDataResonse;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @description: 用友物料属性开放平台接口
 * @author: zpp
 * @create: 2021-08-09
 **/
@Component
public class ProductProApi extends BaseOpenApi {
    public Map<String,Object> save(Map<String,Object> params)
    {
        ApiDataResponse apiDataResponse = postForEntity(OpenApiURL.PRODUCTPRO_SAVE, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public Map<String,Object> detail(Map<String,String> params)
    {
        ApiDataResponse apiDataResponse = getForEntity(OpenApiURL.PRODUCTPRO_DETAIL, params, ApiDataResponse.class);
        return getData(apiDataResponse);
    }
    public List<Map<String,Object>> query(Map<String,Object> params)
    {
        ApiDataArrayResponse apiDataResponse = postForEntity(OpenApiURL.PRODUCTPRO_QUERY, params, ApiDataArrayResponse.class);
        return getData(apiDataResponse);
    }
    public String batchDelete(Map<String,Object> params)
    {
        ApiStringDataResonse apiDataResponse = postForEntity(OpenApiURL.PRODUCTPRO_BATCHDEL, params, ApiStringDataResonse.class);
        return getData(apiDataResponse);
    }
}
